<template>
	<view>

		<view class="p3 c_z l50" style="color: #fff;">

			<view class="">
				<rich-text :nodes="find.content"></rich-text>
			</view>


			<view class="" style="height: 50rpx;">
			</view>
			<button class="b_cff9 by1" type="default " style="margin: 20upx;" @tap="send">
				<text class="p20">我已清楚风险，确定继续</text>
			</button>


		</view>
	</view>
</template>

<script>
	import $H from '@/common/free-lib/request.js';
	export default {
		data() {
			return {
				find: {}
			}
		},
		onLoad() {
			this.init();
		},
		methods: {
			init() {
				const user_id = uni.getStorageSync('user_id');
				const token = uni.getStorageSync('token');
				let requestParams = {
					user_id: user_id,
					token: token,
					id: 23
				};
				$H.post('banmi.php/Article/article_view', 'app', {
					token: false,
					datalist: requestParams
				}).then(ret => {

					this.find = ret.data.data.find;
			 

				})

			},
			send() {
				var that = this;
				uni.showModal({
					title: '提示',
					content: '注销数据将被删除无法恢复',
					confirmText: '确认注销',
					success: function(res) {
						if (res.confirm) {
							that.send1()
						}
					}
				});
			},
			send1() {
				var that = this;
				const user_id = uni.getStorageSync('user_id');
				const token = uni.getStorageSync('token');
				let requestParams = {
					user_id: user_id,
					token: token,
					id: this.id

				};
				$H.post('banmi.php/user/user_del', 'app', {
					token: true,
					datalist: requestParams
				}).then(ret => {

					uni.showToast({
						title: ret.data.msg,
						icon: 'none',
						duration: 1000
					});
					if (ret.data.status == 200) {
						uni.removeStorageSync('token');
						uni.removeStorageSync('user_id');
						uni.removeStorageSync('nickname'); 
						uni.removeStorageSync('face'); 
						setTimeout(function() {
							uni.$emit('banmi_login', {
								title: 1,
							});
					    uni.switchTab({
					    	url:'/pages/index/index'
					    })
						}, 2000);

					}

				})

			}
		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}
</style>
